package com.sky.mapper;

import com.sky.anno.TableInjectAnnotation;
import com.sky.entity.Employee;
import com.sky.enumeration.OperationType;
import com.sky.vo.EmployeeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    Employee getByUsername(String username);

    /**
     * 添加员工
     * @param employee
     */
    @TableInjectAnnotation(OperationType.INSERT)
    void add(Employee employee);

    /**
     * 员工分页查询
     * @param name
     * @return
     */
    List<Employee> page(String name);

    /**
     * 启用禁用和修改员工
     * @param employee
     */

    @TableInjectAnnotation(OperationType.UPDATE)
    void update(Employee employee);


    /**
     * 根据Id查询员工
     * @param id
     */
    Employee findById(Long id);
}
